<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    function callerDemo() {
        if(callerDemo.caller){
            var a= callerDemo.caller.toString();
            alert(a);
        }else{
            alert("this is a top function");
        }
    }
   function implCallerDemo(){
       callerDemo();
   }
   implCallerDemo(); // alert function implCallerDemo


</script>
</body>
</html>